#include "sdPlayer.h"

sdPlayer::sdPlayer() : ship_(5.0, 5.0) {
    ship_.setMass(25.0);
    ship_.getBody().p = cpv(0, 0);
	
	ship_.setDeltaW(40.0);
	ship_.setForwardsForce(80000.0);
	ship_.setReverseForce(80000.0);
	ship_.setLeftForce(80000.0);
	ship_.setRightForce(80000.0);

	int count = 3;
	cpVect verts[] = {
		cpv(-15, -15),
		cpv( 0,   20),
		cpv( 15, -15),
	};
	
	ship_.addPolyShape(count, verts, cpvzero, 1);
    
    /*ship_.insert();*/
}

void sdPlayer::move(cpVect& direction) {
	ship_.move(direction);
}

void sdPlayer::turn(cpVect& direction) {
	ship_.turn(direction);
}
bool sdPlayer::shoot(int weapon, std::set<sdTimed*>* bullets) {
    return ship_.shoot(weapon, bullets);
}


